home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM 3
/
Light ROM 3 - Disc 2.iso
/
programs
/
amiga
/
macromkr
/
rexxscri.lha
/
REXXscripts
/
loadiff2.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1980-01-05
|
3KB
|
96 lines
/*
LoadIFF.rexx
======================================================================
Usage:
rx LoadIFF <filename>
where <filename> is a complete path to any valid IFF picture file
note: no spaces allowed in filename or path!
Purpose:
To allow external scripts to load images into Black Belt System's
Imagemaster. The primary buffer is killed, and the given filename
is then loaded.
This script assumes that Imagemaster is already running. This is not a
"PI" rexx file, but is intended to be run from a shell.
Don't attempt to run this from Imagemaster's sequence processor - it
won't work!
Written by: James Hastings-Trew, based on work by Pete Patterson
======================================================================
*/
parse arg filename
/*
check args and print help if wrong ===================================
*/
if filename = "" then do
do hlpline = 2 to 22 by 1
say sourceline(hlpline)
end
exit 0
end
prtnme = 'IM_Port'
cmdpath = 'cmpi:'
/*
open rexxsupport.library -- needed for some functions ================
*/
if ~show('L',"rexxsupport.library") then do
if addlib('rexxsupport.library',0,-30,0) then do
/* everything's ok */
end;
else do
say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
say 'Cannot operate JPEG.rexx without this library - sorry!';
exit 10;
end;
end;
/*
expand file name =====================================================
*/
filename = strip(filename)
if index(filename,':') = 0 then do
cdr = pragma(D)
if (right(cdr,1)~=':')&(right(cdr,1)~='/')&(cdr~='') then cdr=cdr||'/'
filename = cdr||filename
end
/*
seperate path and filename ===========================================
*/
tmpn = reverse(filename)
seploc = 0
if index(tmpn,'/')~=0 then seploc=(length(tmpn))-(index(tmpn,'/'))+1
else do
if (index(tmpn,':')~=0) then seploc=(length(tmpn))-(index(tmpn,':'))+1
end
thispath = left(filename,seploc)
filename = substr(filename,seploc+1)
/*
Kill primary buffer ==================================================
*/
address(prtnme)
'autoredraw 0'
options results
'current'
bufdata = result
options
parse var bufdata bname ',' bnum ',' bx ',' by ',' btot ',' bmem ',' bparname ',' bparnum
if bname ~= '<none>' then do
address(prtnme)
'killbuff '||bnum
address
end
/*
Find and load new image ==============================================
*/
options results
call setclip(filename,thispath)
address(prtnme)
'imagepath '||thispath
'load '||filename
address
options
exit 0